package com.hand.wyc24548.domain.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;
import org.hzero.core.base.BaseConstants;
import org.hzero.core.util.Regexs;

import com.fasterxml.jackson.annotation.JsonInclude;

import io.choerodon.mybatis.annotation.ModifyAudit;
import io.choerodon.mybatis.annotation.VersionAudit;
import io.choerodon.mybatis.domain.AuditDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hzero.export.annotation.ExcelColumn;
import org.hzero.export.annotation.ExcelSheet;

/**
 * @Author wangyc
 * @create 2019/8/6 10:01
 */

@ExcelSheet(zh = "销售订单信息",en = "Order")
@ApiModel("销售订单信息")
@ModifyAudit
@VersionAudit
@Table(name = "hodr_so_header")
@JsonInclude(JsonInclude.Include.NON_NULL)  // 数据返回前端时，排除为空的字段
public class SoHeader extends AuditDomain {

//    private static final String FIELD_SOHEADERID="soHeaderId";
//    private static final String FIELD_SOHEADERNUMBER="orderNumber";
//    private static final String FIELD_COMPANYID="companyId";
//    private static final String FIELD_ORDERDATE="orderDate";
//    private static final String FIELD_ORDERSTATUS="orderStatus";
//    private static final String FIELD_CUSTOMERID="customerId";

    @Id
    @GeneratedValue
    @ApiModelProperty("订单头ID")
    private Long soHeaderId;
    @Length(max = 60)
    @Pattern(regexp = Regexs.CODE, message = "订单编号格式不正确") // 格式控制
    @NotBlank
    @ApiModelProperty("订单编号")
    @ExcelColumn(zh = "订单编号",en = "orderNumber",showInChildren=true)
    private String orderNumber;
    @Length(max = 20)
    @NotBlank
    @ApiModelProperty("公司ID")
    private Long companyId;
    @ApiModelProperty("订单日期")
    @ExcelColumn(zh = "订单日期",en = "orderDate",pattern = BaseConstants.Pattern.DATE)
    private Date orderDate;
    @Length(max = 30)
    @NotBlank
    @ApiModelProperty("订单状态")
    @ExcelColumn(zh = "订单状态",en = "orderStatus",showInChildren=true)
    private String orderStatus;
    @Length(max = 20)
    @NotBlank
    @ApiModelProperty("客户ID")
    private Long customerId;

    @Transient
    @ApiModelProperty("公司名称")
    @ExcelColumn(zh = "公司名称",en = "companyName",showInChildren=true)
    private String companyName;
    @Transient
    @ApiModelProperty("客户名称")
    @ExcelColumn(zh = "客户名称",en = "customerName",showInChildren=true)
    private String customerName;
    @Transient
    @ApiModelProperty("订单数量")
    @ExcelColumn(zh = "订单数量",en = "orderQuantity",showInChildren=true)
    private BigDecimal orderQuantity;
    @Transient
    @ApiModelProperty("销售单价")
    @ExcelColumn(zh = "销售单价",en = "unitSellingPrice",pattern = BaseConstants.Pattern.TB_ONE_DECIMAL)
    private BigDecimal unitSellingPrice;
    @Transient
    @ApiModelProperty("行号")
    @ExcelColumn(zh = "行号",en = "lineNumber",showInChildren=true)
    private Integer lineNumber;
    @Transient
    @ApiModelProperty("物料编码")
    @ExcelColumn(zh = "物料编码",en = "itemCode",showInChildren=true)
    private String itemCode;
    @Transient
    @ApiModelProperty("物料描述")
    @ExcelColumn(zh = "物料描述",en = "itemDescription",showInChildren=true)
    private String itemDescription;
    @Transient
    @ApiModelProperty("产品单位")
    @ExcelColumn(zh = "产品单位",en = "orderQuantityUom",showInChildren=true)
    private String orderQuantityUom;
    @Transient
    @ApiModelProperty("备注")
    @ExcelColumn(zh = "备注",en = "description",showInChildren=true)
    private String description;


    public Long getSoHeaderId() {
        return soHeaderId;
    }

    public void setSoHeaderId(Long soHeaderId) {
        this.soHeaderId = soHeaderId;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public BigDecimal getOrderQuantity() {
        return orderQuantity;
    }

    public void setOrderQuantity(BigDecimal orderQuantity) {
        this.orderQuantity = orderQuantity;
    }

    public BigDecimal getUnitSellingPrice() {
        return unitSellingPrice;
    }

    public void setUnitSellingPrice(BigDecimal unitSellingPrice) {
        this.unitSellingPrice = unitSellingPrice;
    }

    public Integer getLineNumber() {
        return lineNumber;
    }

    public void setLineNumber(Integer lineNumber) {
        this.lineNumber = lineNumber;
    }

    public String getOrderQuantityUom() {
        return orderQuantityUom;
    }

    public void setOrderQuantityUom(String orderQuantityUom) {
        this.orderQuantityUom = orderQuantityUom;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getItemCode() {
        return itemCode;
    }

    public void setItemCode(String itemCode) {
        this.itemCode = itemCode;
    }

    public String getItemDescription() {
        return itemDescription;
    }

    public void setItemDescription(String itemDescription) {
        this.itemDescription = itemDescription;
    }
}
